package leetcode.N701_N800;

public class N717 {

    public static void main(String[] args) {
        int[] bits = {1,1,0};
        System.out.println(isOneBitCharacter(bits));

    }


    static boolean isOneBitCharacter(int[] bits) {
        int length = bits.length;
        if (length == 1) {
            return true;
        }
        int numCount = 0;
        for (int i = length - 2; i >= 0 && bits[i] == 1; i--) {
            numCount++;
        }
        return (numCount & 1) == 0;
    }
}